package com.xutong.myfunction.activity;

import android.os.Build;
import android.os.Bundle;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.xutong.myfunction.R;
import com.xutong.myfunction.custom.CustomLunBo;

import java.util.List;

public class LunBoActivity extends AppCompatActivity {

    private ViewPager vpMainAdvert;
    private List<ImageView> imageList;
    private LinearLayout llAdvertBtn;
    private List<Button> btnList;

    private CustomLunBo customLunBo = null;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_lun_bo);
//        ActionBar actionBar = getSupportActionBar();
//        actionBar.hide();
        vpMainAdvert = (ViewPager) findViewById(R.id.vpMainAdvert);
        llAdvertBtn = (LinearLayout) findViewById(R.id.llAdvertBtn);

        customLunBo = new CustomLunBo(this,vpMainAdvert,llAdvertBtn);

    }

    @Override
    protected void onResume() {
        super.onResume();

        customLunBo.start();

    }

    @Override
    protected void onPause() {
        super.onPause();

        customLunBo.stop();

    }

    @Override
    public void onWindowFocusChanged(boolean hasFocus) {
        super.onWindowFocusChanged(hasFocus);
        if (hasFocus && Build.VERSION.SDK_INT >= 19) {
            View decorView = getWindow().getDecorView();
            decorView.setSystemUiVisibility(
                    View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                            | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                            | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                            | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
                            | View.SYSTEM_UI_FLAG_FULLSCREEN
                            | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
        }
//        else {
//            ActionBar actionBar = getSupportActionBar();
//            actionBar.hide();
//        }
    }
}
